home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # Subject: making default lp printing dump to lpr
- #
- # lp interface that invokes lpr. lpr can then invoke a network printer.
- # This file allows printing to lpr from workspace.
- #
- # Instructions:
- #
- # Before beginning set up the /etc/printcap and the lpr software.
- #
- # 1. Create this file in /usr/spool/lp/model. Filename is lptolpr
- # 2. Change the file to be owned by lp:
- # # chown lp lptolpr
- # # chgrp lp lptolpr
- # 3. Set the -P argument to lpr in the code below. Here it is set to
- # 'remote'. It should be set to the name of the LPR spooler set-up
- # on this system.
- # 4. Install the print spooler:
- # # /usr/lib/lpshut
- # # /usr/lib/lpadmin -p<printer_name> -v/dev/null -mlptolpr
- # # /usr/lib/lpsched
- # # /usr/lib/accept <printer_name>
- # # enable <printer_name>
- # # /usr/lib/lpadmin -d<printer_name>
- #
- # <printer_name> = the name of the lp printer on this system.
- #
- # To remove the lp printer:
- # # /usr/lib/lpshut
- # # /usr/lib/lpadmin -x<printer_name>
- #
- # The command "/usr/lib/lpadmin -d<printer_name>" sets the
- # default printer. You can also set the default printer from
- # the Print Manager utility.
- #
- # After the installation is complete the file lptolpr is moved to the
- # directory: /usr/spool/lp/interface and is named <printer_name>
- #
- # Debugging: Chances are you can not type this file in without
- # an error. To find a line with the error invoke the script directly
- # with the command: 'lptolpr 0 0 0 1 0 /etc/passwd'. If the script is
- # ok the passwd file will print. If there is a bug you will see the
- # line number of the bug.
- #
- # START CODE
- #
- # This line is needed to print from workspace:
- TYPE=Dumb
- #
- # Grab command line arguments
- seqid=$1 # Not used
- name=$2i # Not used
- title="$3" # Not used
- copies=$4
- options="$5" # Not used
- shift; shift; shift; shift; shift
- files="$*"
-
- # Print the files
- i=1
- while [ $i -le $copies ]
- do
- for file in $files
- do
-
- # v---- This is the name of the lpr printer
- # on this system.
-
- lpr -Premote "$file"
- # ^-- Leave a space here
- # (common edit error)
- done
- i=`expr $i + 1`
- done
-
- exit 0
-